package com.powernode.settings.dao;

import com.powernode.settings.bean.DicValueBean;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface DicValueMapper {
    int deleteByPrimaryKey(String id);

    int insert(DicValueBean record);

    int insertSelective(DicValueBean record);

    DicValueBean selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(DicValueBean record);

    int updateByPrimaryKey(DicValueBean record);

    /**
     * 查询字典值是否正在使用某个字典类型
     * @param codes
     * @return
     */
    List<DicValueBean> selectBatchByCode(String[] codes);

    List<DicValueBean> selectAll(@Param("code") String code);

    /**
     * 根据字典类型和字典查询
     * @param typeCode
     * @param value
     * @return
     */
    DicValueBean selectByTypeCodeAndValue(@Param("code") String typeCode,
                                          @Param("value") String value);


    int delBatch(String[] ids);


    /**
     * 根据字典类型编码查询字典值
     * @param code
     * @return
     */
    List<DicValueBean> selectByCode(String code);

}